<!DOCTYPE html>
<html lang="zh-cn">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app">
      <button @click="c = 'green'">修改颜色</button>
      <!-- <div v-bind:style="{color: c}">我是div</div> -->

      <!-- v-bind可以简写，多个样式之间逗号隔开 -->
      <!-- <div :style="{color: c, fontSize: size}">我是div</div> -->

  
      <!-- <div :style="{color: color, fontSize: size}">我是div</div> -->
      <!-- 左右两边一样可以简写 -->
      <div :style="{color, fontSize: size}">我是div</div>
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        el: '#app',
        data () {
          return {
            c: 'red',
            size: '24px',
            color: '#00f'
          }
        },
        methods: {}
      })
    </script>
  </body>
</html>
